package com.org.gsc.zsqdemos.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.org.gsc.zsqdemos.R;

/**
 * Created by qundui on 2017/6/17.
 */
public class A extends android.support.v4.app.Fragment {
    private int position;

    public static A newInstance(int position) {
        A f = new A();
        Bundle b = new Bundle();
        b.putInt("pos", position);
        f.setArguments(b);
        return f;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        position = getArguments().getInt("pos");
    }
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.test,container,false);
        TextView textView= (TextView) view.findViewById(R.id.tv);
        textView.setText("第"+ (position+1)+"tab");
        return view;
    }
}
